Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
How `String["fromCharCode"]` acts like `String.fromCharCode()` in javascript?

Search engine will ignore the [ ] ", so I can't get the answer. I took a test and find out they resulted the same, but I'm a js rookie and I don't know how they equals to each other.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

fromCharCode 'lives' as a static method of the String Object. Such a method has a key and a value, visualised: {fromCharCode: function() {...}}. You can retrieve (access) the method using it's key directly String.fromCharCode or 'bracket' style String['fromCharCode']. This is true for all Objects.

The bracket notation may be usefull when the key contains special characters, see snippet.

See also

const someObj = {
  dotNotation: 'hello world',
  'non dot Notation': 'hello world you too',
};

console.log(someObj.dotNotation);
// the last property can not be retrieved with dot notation
// console.log(someObj.non dot Notation);
// so
console.log(someObj['non dot Notation']);

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda